package com.intro.database;



import org.hibernate.SessionFactory;
import org.hibernate.Transaction;
import org.hibernate.cfg.AnnotationConfiguration;
import org.hibernate.cfg.Configuration;
import org.hibernate.classic.Session;
import org.hibernate.tool.hbm2ddl.SchemaExport;


public class TestHibernate {
	public static void main(String[] args) {
		 Configuration config = new AnnotationConfiguration();  
		  SessionFactory sessionFactory = config.configure().buildSessionFactory();
		  Session se = sessionFactory.openSession();
		  Transaction tx =  se.beginTransaction();
		  SchemaExport schemaExport = new SchemaExport(config);     
          schemaExport.create(true, true);
		  System.out.println(se);
		  tx.commit();
	}
}
